
program hello
    implicit none
    integer a(20)
    integer i,n

    integer na,b
    parameter (na=20)
    integer pst(na,na)

!part1
    do i=1,20
        a(i)=i
    end do
     write (*,10) (a(i),i=1,20)
10 format(5i6)
     print*, ' '
     write (*,20) (a(i),i=1,20)
20 format(5i3)

        write (*, 30) (n,n=1,9)
30    format(3i2)


!part2
    !b=yanghui(pst,na)


end program

!patr2 function
integer function yanghui(pst,na)
    integer na,i,j
    dimension pst(na,na)
    do i=1,na !two sides equal 1
        pst(i,1)=1
        pst(i,i)=1
    end do

    do i=3,na
        do j=2,i-1
            pst(i,j)=pst(i-1,j-1)+pst(i-1,j)
        end do
    end do

end function
